billing-ux

(0 reviews)

TMF 677 POST - Query Usage Consumption

Queries Usage Consumption

URL
https://[localhost]:[port]/billing-ux/v1/{businessId}/queryUsageConsumption
url Param
nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country code (TT, BB, JM, PA, etc.) identifying the business unit.Y
nametypedescriptionrequired
client_idstringThe client_id identifying the channel. Minimum characters: 5Y
client_secretstringPassword associated with the client_id. Minimum characters: 5Y
X-Correlation-IDstringIdentifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction.Y
Request for Technical appointment:
curl --location --request POST 'https://nonprod.esb.cloud.lla.com/dev/billing-ux/v1/PR/queryUsageConsumption' \
--header 'client_id: 12345' \
--header 'client_secret: abcde' \
--header 'X-Correlation-ID: 8417a2ba-19ae-4523-b63b-d99fcab9b5d5' \
--header 'Content-Type: application/json' \
--data-raw '{
  "@type": "QueryUsageConsumption",
  "queryUsageConsumptionDate": "2026-09-17T09:12:44Z",
  "searchCriteria": {
    "@baseType": "UsageConsumption",
    "partyAccount": [
      {
        "id": "287410093",
        "@referredType": "BillingAccount"
      }
    ],
    "logicalResource": [
      {
        "id": "7875551234",
        "@referredType": "MSISDN",
        "consumptionSummary": [
          {
            "consumptionPeriod": {
              "endDateTime": "1985-04-12T23:20:50.52Z",
              "startDateTime": "1985-04-12T23:20:50.52Z"
            }
          }
        ],
        "characteristic": [
          {
            "name": "paymentType",
            "valueType": "string",
            "value": "postpaid"
          },
          {
            "name": "bill",
            "valueType": "object",
            "value": {
              "id": "4471829",
              "@referredType": "CustomerBill"
            }
          }
        ]
      }
    ]
  }
}'
Definitions

Each of the request parameters is detailed.

nametypedescriptionrequired
queryUsageConsumptionDatedatetimeDate when the query was submittedN
searchCriteria.'@baseType'stringWhen sub-classing, this defines the super-class - UsageConsumptionN
searchCriteria.partyAccount[].idstringBilling account number - BANCANN
searchCriteria.partyAccount[].'@referredType'stringReference Type BillingAccountN
searchCriteria.logicalResource[].idstringMobile subscriber number - MSISDNN
searchCriteria.logicalResource[].'@referredType'stringReference Type MSISDNN
searchCriteria.logicalResource[].consumptionSummary[].consumptionPeriod.endDateTimedatetimeend date of the consumption periodN
searchCriteria.logicalResource[].consumptionSummary[].consumptionPeriod.startDateTimedatetimestart date of the consumption periodN
searchCriteria.logicalResource[].characteristic[name=paymentType].valuestringDefines the payment type prepaid or postpaidN
searchCriteria.logicalResource[].characteristic[name=bill].value.idstringInvoice NumberN
searchCriteria.logicalResource[].characteristic[name=bill].value.'@referredType'stringReference Type CustomerBillN
searchCriteria.logicalResource[].characteristic[name=paymentType].valueTypestringDefines the type of value - stringN
searchCriteria.logicalResource[].characteristic[name=bill].valueTypestringDefines the type of value - objectN
Response
{
  "usageConsumption": [
    {
      "logicalResource": [
        {
          "id": "9876543210",
          "@referredType": "MSISDN",
        }
      ],
      "partyAccount": [
        {
          "id": "BAN-4455667788",
          "@referredType": "BillingAccount"
        }
      ],
      "bucketRefOrValue": [
        {
          "usageType": "voice",
          "@type": "BucketRefOrValue",
          "bucketCounter": [
            {
              "counterType": "used",
              "value": {
                "amount": 320,
                "units": "MINUTES",
              },
              "@type": "ConsumptionSummary"
            },
            {
              "counterType": "usedCharge",
              "value": {
                "amount": 15,
                "units": "USD",
              },
              "@type": "ConsumptionSummary"
            },
            {
              "counterType": "outOfBucket",
              "value": {
                "amount": 15,
                "units": "MINUTES",
              },
              "@type": "ConsumptionSummary"
            },
             {
              "counterType": "outOfBucketCharge",
              "value": {
                "amount": 15,
                "units": "USD",
              },
              "@type": "ConsumptionSummary"
            }
          ]
        },
        {
          "usageType": "sms",
          "@type": "BucketRefOrValue",
          "bucketCounter": [
            {
              "counterType": "used",
              "value": {
                "amount": 210,
                "units": "MESSAGES",
              },
              "@type": "ConsumptionSummary"
            },
            {
              "counterType": "usedCharge",
              "value": {
                "amount": 15,
                "units": "USD",
              },
              "@type": "ConsumptionSummary"
            },
            {
              "counterType": "outOfBucket",
              "value": {
                "amount": 8,
                "units": "MESSAGES",
              },
              "@type": "ConsumptionSummary"
            },
            {
              "counterType": "outOfBucketCharge",
              "value": {
                "amount": 15,
                "units": "USD",
              },
              "@type": "ConsumptionSummary"
            }
          ]
        },
        {
          "usageType": "data",
          "@type": "BucketRefOrValue",
          "bucketCounter": [
            {
              "counterType": "used",
              "value": {
                "amount": 4096,
                "units": "MB"
              },
              "@type": "ConsumptionSummary"
            },
                {
              "counterType": "usedCharge",
              "value": {
                "amount": 15,
                "units": "USD",
              },
              "@type": "ConsumptionSummary"
            },
            {
              "counterType": "outOfBucket",
              "value": {
                "amount": 512,
                "units": "MB"
              },
              "@type": "ConsumptionSummary"
            },
             {
              "counterType": "outOfBucketCharge",
              "value": {
                "amount": 15,
                "units": "USD",
              },
              "@type": "ConsumptionSummary"
            }
          ]
        }
      ],
      "@type": "UsageConsumption"
    }
  ]
}
Definitions

Each of the response parameters is detailed.

nametypedescriptionrequired
usageConsumptionarrayReport with current counters and balancesN
usageConsumption[].logicalResourcearrayreference to the LogicalResource eg MSISDNN
usageConsumption[].logicalResource[].idstringMobile subscriber number - MSISDNN
usageConsumption[].logicalResource[].'@referredType'stringReference Type MSISDNN
usageConsumption[].partyAccountarrayA reference to the account that owns the bucketN
usageConsumption[].partyAccount[].idstringBilling account number - BANCANN
usageConsumption[].partyAccount[].'@referredType'stringReference Type BillingAccountN
usageConsumption[].bucketRefOrValuearrayBucket(s) included in the offer or option subscribed.N
usageConsumption[].bucketRefOrValue[].usageTypestringType of usage. Value - voice,sms,dataN
usageConsumption[].bucketRefOrValue[].'@type'stringWhen sub-classing, this defines the sub-class Extensible name. BucketRefOrValueN
usageConsumption[].bucketRefOrValue[].bucketCounterarrayDefines the details of each bucketN
usageConsumption[].bucketRefOrValue[].bucketCounter[].counterTypestringDefines the Type of parameter. Value - used,usedCharge,outOfBucket',outOfBucketCharge'N
usageConsumption[].bucketRefOrValue[].bucketCounter[].valueobjectDefines the amount in a given unitN
usageConsumption[].bucketRefOrValue[].bucketCounter[].value.amountintegerAmount or QuantityN
usageConsumption[].bucketRefOrValue[].bucketCounter[].value.unitsstringDefines the unit of amount or QuantityN
usageConsumption[].bucketRefOrValue[].bucketCounter[].'@type'stringWhen sub-classing, this defines the sub-class Extensible name. ConsumptionSummaryN
usageConsumption[].'@type'stringWhen sub-classing, this defines the sub-class Extensible name. UsageConsumptionN

Possible response error

In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.

[ 400 ]

Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

{
  "errors" : [{
      "code" : 400,
      "message" : "The request is invalid or not properly formed.",
      "description" : "Malformed request syntax, invalid request message framing, or deceptive request routing."
    }]
}
[ 401 ]

Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.

{
  "errors" : [{
      "code" : 401,
      "message" : "The user could not be authenticated for this request.",
      "description" : "The request has not been applied because it lacks valid authentication credentials for the target resource."
    }]
}
[ 404 ]

Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

{
  "errors" : [{
      "code" : 404,
      "message" : "The server could not find the requested resource.",
      "description" : "The requested operation failed because a resource associated with the request could not be found."
    }]
}
[ 405 ]

Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.

{
    "errors": [{
            "code": 405,
             "message": "APIKIT:METHOD_NOT_ALLOWED",
             "description": "HTTP Method PATCH not allowed for : /{businessId}/queryUsageConsumption"
        }]
}
[ 500 ]

Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.

{
  "errors" : [{
      "code" : 500,
      "message" : "Internal Server Error",
      "description": "The request failed due to an internal error."
    }]
}
[ 501 ]

Not implemented - indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.

{
  "errors" : [{
      "code" : 501,
      "message" : "Not implemented",
      "description" : "Operation GET /queryUsageConsumption for Business Id: xxxx not implemented"
    }]
  }

Reviews